import { Column, Entity, OneToMany, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';
import Company from './company.entity';

// 招聘会
@Entity('job_fairs')
export default class JobFairs extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @OneToMany(() => Company, (company) => company.jobFairs)
  companys: Company[];

  @Column({ comment: '标题' })
  title: string;

  @Column({ comment: '图片' })
  image: string;

  @Column({ name: 'start_time', comment: '开始时间' })
  startTime: Date;

  @Column({ name: 'end_time', comment: '结束时间' })
  endTime: Date;

  @Column({ comment: '招聘会地址' })
  address: string;

  @Column({ name: 'enable_status', default: 1, comment: '启用状态' })
  enableStatus: number;
}
